import torch
import numpy as np
import random


class Net(torch.nn.Module):
    def __init__(self):
        super(Net, self).__init__()


n_sample = 100
batch_size = 1
learning_rate = 0.1
n_epoch = 1
total_batch_count = n_sample // batch_size

# 生成训练数据，第一维10个，第二维2个
train_in = [
    [random.uniform(0, 1) for c in range(2)] for n in range(10)
]
# 期望输出，初始化为 0
train_out = [
    0.0 for n in range(10)
]

for i in range(10):
    train_out[i] = max(train_in[i][0], train_in[i][1])
src_data = np.asarray(train_in)
for epoch in range(n_epoch):
    np.random.shuffle(src_data)  # 会改变底层数组元素
    # for i in range(total_batch_count):

